﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SceneMove : MonoBehaviour
{
    //Renderer rd;
    //void Start()
    //{
    //    rd = GetComponent<Renderer>();
    //}

    void Update()
    {
        transform.Translate(transform.right * 0.7F * -Time.deltaTime);


        if (transform.position.x <= -18)
        {
            transform.position += Vector3.right * 18 * 2;
        }

    }


    //// -- 判断物体是否在相机的6个面内
    //bool IsVisibleFrom(Renderer renderer, Camera camera)
    //{
    //    Plane[] planes = GeometryUtility.CalculateFrustumPlanes(camera);
    //    return GeometryUtility.TestPlanesAABB(planes, renderer.bounds);
    //}
}
